![]() |
PBAllocateForkSync |
||||
Header: | Files.h | Carbon status: | Supported | |
Attempts to reserve space on a volume for use by an open fork.
OSErr PBAllocateForkSync ( FSForkIOParam *paramBlock );
A pointer to a parameter block
A result code.
The relevant fields of the parameter block are:
On input, a pointer to a completion routine.
On output, the result code of the function.
On input, the reference number of the fork.
On input, controls how new space is allocated. If the kAllocContiguousMask is set, then then any newly allocated space must be in one contiguous extent (preferably contiguous with any space already allocated). If kAllocAllOrNothingMask is set, then the entire requestCount bytes must be allocated for the call to succeed; if not set, as many bytes as possible will be allocated (without error). If kFSAllocNoRoundUpMask is set, then no additional space is allocated (such as rounding up to a multiple of a clump size); if clear, the volume format may allocate more space than requested as an attempt to reduce fragmentation. See
On input, the base location for the start of allocation.
On input, the offset of the start of allocation.
On input, the number of bytes to allocate. On output, the number of bytes actually allocated to the file. The number of bytes allocated may be smaller than the requested amount if some of the space was already allocated. The value returned in this parameter does not reflect any additional bytes that may have been allocated because space is allocated in terms of fixed units such as allocation blocks, or the use of a clump size to reduce fragmentation.
This call will attempt to allocate the number of requested bytes of physical storage starting at the offset specified by positionMode and positionOffset. For volume formats that support preallocated space, you can later write to this range of bytes (including extending the size of the fork) without requiring an implicit allocation.
Any extra space allocated but not used will be deallocated when the fork is closed, using FSCloseFork, or flushed, using FSFlushFork.
Supported in Carbon. Available in Mac OS 9, and later when Carbon 1.0.2 or later is present.
© 2000 Apple Computer, Inc. — (Last Updated 5/8/2000)